#{extends 'admintemplate.html'/}
#{set title:'Home'/}
#{set main_title:'Advertising'/}
#{set sub_title:'Advertising Management'/}
#{set current_home:'active'/}
#{set 'moreScripts'}
#{/set}
<div class="span12">
	#{if homeAdvs.size() !=0 }
	<div id="table-content">
		<table id="product-table">
		<tr>
			<th class="table-header-check"><a id="toggle-all" ></a> </th>
			<th class="table-header-repeat line-left minwidth-1"><a href="">Id</a>	</th>
			<th class="table-header-options line-left"><a href="">Options</a></th>
		</tr>
		#{list items: homeAdvs, as:'homeAdv'}
			<tr>
				<td><input  type="checkbox"/></td>
				<td>${homeAdv?.id}</td>
				<td class="options-width">
				<a href="#" onClick="loadContent(${homeAdv?.id})" title="Admin" class="">Edit</a>
				<a href="#" onClick="deleteCategory(${homeAdv?.id})" title="Delete" class="">Remove</a>
				</td>
			</tr>
		#{/list}
		</table>
	</div>
	#{/if}
	<div class="well" style="padding: 16px 19px;">
		<form id="addCategoryForm" action="@{Admin.homeAdvCreate}" method="post" enctype="multipart/form-data" class="form">
			<fieldset>
				<div class="clearfix">
            		<label for="top">Top Banner</label>
            		<div class="input">
              			<textarea rows="3" name="top" id="ckeditor"></textarea>
           			 </div>
          		</div>
          		<div class="clearfix">
            		<label for="main">Main Banner</label>
            		<div class="input">
              			<textarea rows="3" name="main" id="ckeditor1"></textarea>
           			 </div>
          		</div>
          		<div class="clearfix">
            		<label for="left">Left Banner</label>
            		<div class="input">
              			<textarea rows="3" name="left" id="ckeditor2"></textarea>
           			 </div>
          		</div>
          		<div class="clearfix">
            		<label for="right">Right Banner</label>
            		<div class="input">
              			<textarea rows="3" name="right" id="ckeditor3"></textarea>
           			 </div>
          		</div>
          		<div class="clearfix">
            		<label for="bottom">Bottom Banner</label>
            		<div class="input">
              			<textarea rows="3" name="bottom" id="ckeditor4"></textarea>
           			 </div>
          		</div>
          		<div class="clearfix">
            		<label for="before">Item before Banner</label>
            		<div class="input">
              			<textarea rows="3" name="before" id="ckeditor5"></textarea>
           			 </div>
          		</div>
          		<div class="clearfix">
            		<label for="after">Item after Banner</label>
            		<div class="input">
              			<textarea rows="3" name="after" id="ckeditor6"></textarea>
           			 </div>
          		</div>
				<input type="hidden" name="homeAdvId" id="homeAdvId" />
				<div class="actions">
					<input type="submit" class="btn primary" value="Thêm/Cập nhật" />
				</div>
			</fieldset>
		</form>
	</div>
</div>
<!--  end content -->